package com.tangyanbo.filemanager.menu;

import com.tangyanbo.android.FileManager.R;

import android.view.Menu;

public class ManagerMenu {	
	
	public static final int NEW = 0;
	
	public static final int EDIT = 1;
	
	public static final int PASTE = 2;
	
	public static final int GOTOROOT = 3;
	
	public static final int DELETE = 4;
	
	private static final String NEW_STRING = "新建";
	
	private static final String EDIT_STRING = "编辑";
	
	private static final String PASTE_STRING = "粘贴";
	
	private static final String GOTOROOT_STRING = "根目录";
	
	private static final String DELETE_STRING = "删除";
	
	private static final int NEW_ICON = R.drawable.add;
	
	private static final int EDIT_ICON = R.drawable.edit;
	
	private static final int PASTE_ICON = R.drawable.paste;
	
	private static final int GOTOROOT_ICON = R.drawable.home;
	
	private static final int DELETE_ICON = R.drawable.delete;	
	

	public static void createOptionsMenu(Menu menu,boolean editMode) {
		menu.clear();
		if(editMode){
			menu.add(0, DELETE, 0, DELETE_STRING).setIcon(DELETE_ICON);
		}else{
			menu.add(0, NEW, 0, NEW_STRING).setIcon(NEW_ICON);
			menu.add(0, EDIT, 0, EDIT_STRING).setIcon(EDIT_ICON);
			menu.add(0, PASTE, 0, PASTE_STRING).setIcon(PASTE_ICON);
			menu.add(0, GOTOROOT, 0, GOTOROOT_STRING).setIcon(GOTOROOT_ICON);
		}
	}
}
